home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
DATABASE.DIR
/
00096_Script_PICTURES
< prev
next >
Wrap
Text File
|
1996-03-28
|
5KB
|
155 lines
-- --------------------------------------------------------------
-- Handler showTopicPicture
on showTopicPicture
global textSprite, clickedTopic, pictureSprite, pictureR, pictureT,pictureB, pictureL
global currentPicture
set pictureCast = getPictureCastNumber(clickedTopic, currentPicture)
if (pictureCast = -1) then -- no picture
errorAlert("No picture for" && clickedTopic)
exit
end if
-- empty the text
set the castNum of sprite textSprite = the number of cast "Empty Text"
-- show the picture
set the castNum of sprite pictureSprite = the number of cast pictureCast
global pictureH, pictureV
set the locH of sprite pictureSprite = pictureH
set the locV of sprite pictureSprite = pictureV
-- is the following needed? it was already commented out
-- spriteBox pictureSprite,pictureL,pictureT,pictureR,pictureB
showTopicPictureCaption
showMoreButtons
-- is the following needed? it was already commented out
-- setClearedFlag(False)
updateStage
end
-- --------------------------------------------------------------
-- Handler removeTopicPicture
on removeTopicPicture
global pictureSprite
removeFromStage(pictureSprite)
removeTopicPictureCaption
addLine
end
-- --------------------------------------------------------------
-- Handler renamePictures
on renamePictures startCast,numPictures
repeat with i = 1 to numPictures
set PictureNamesInfo = the text of cast "PictureNames"
set NamePicture = line i of PictureNamesInfo
set the name of cast (startCast + i - 1) = NamePicture && "PICTURE"
end repeat
end
-- --------------------------------------------------------------
-- Handler isPictureTitle returns TRUE if the given title is
-- the title of a picture and FALSE otherwise.
on isPictureTitle whichTitle
global pictureTitles
return pictureTitles contains whichTitle & RETURN
end
-- --------------------------------------------------------------
-- Handler resetCurrentPicture resets the global variable currentPicture
-- to 1. This global variable is used to indicate the picture number
-- of the currently displayed topic (to know what picture
-- number the previous and next pictures are for moreUp and moreDown).
on resetCurrentPicture
global currentPicture
set currentPicture = 1
end
-- --------------------------------------------------------------
-- Handler updateCurrentPicture sets the global variable currentPicture
-- to the next picture in the given direction.
on updateCurrentPicture direction
global currentPicture
set currentPicture = currentPicture + direction
end
-- --------------------------------------------------------------
-- Handler setCurrentPicture sets the global variable currentPicture
-- to the picture number of the current topic picture.
on setCurrentPicture -- called from ???
global currentPicture, pictureSprite
set currentPicture = value(the last char of the name of cast the castNum of sprite pictureSprite)
end
-- --------------------------------------------------------------
-- Handler showPrevPicture activates the more up button and then
-- calls showMorePicture to show the previous picture and caption.
on showPrevPicture
global pageUpButton
if isEnabled(pageUpButton) then
activateButtonThenEnable(pageUpButton)
showMorePicture(-1)
end if
end
-- --------------------------------------------------------------
-- Handler showNextPicture activates the more down button and then
-- calls showMorePicture to show the next picture and caption.
on showNextPicture
global pageDownButton
if isEnabled(pageDownButton) then
activateButtonThenEnable(pageDownButton)
showMorePicture(1)
end if
end
-- --------------------------------------------------------------
-- Handler showMorePicture shows the next page of the text in the given
-- direction.
on showMorePicture direction
global pictureSprite
set nextPictureCastNumber = getNextPictureCast(direction)
set the castNum of sprite pictureSprite = nextPictureCastNumber
updateCurrentPicture(direction)
updateCurrentCaption(direction)
showTopicPictureCaption
showMoreButtons
updateStage
end
-- --------------------------------------------------------------
-- Handler getNextPictureCast returns the cast number of the next picture
-- if the current topic has more pictures and -1 otherwise.
on getNextPictureCast direction
global pictureSprite, currentPicture
waitCursor
set castNumber = getPictureCastNumber(clickedTopic, currentPicture + direction)
normalCursor
return castNumber
end